import TestProps from "@/pages/testProps";

// 创建时间方法。https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date
const date1 = new Date();

// 另外一种字符串不考虑。2020-12-21T3:11:3 都为两位数
const date2 = new Date("2020-12-21T03:24:00");

const date4 = new Date("2020-12-21 3:22:00");
// 月是从0开始。
const date3 = new Date(2020, 11, 21, 1, 2, 3);

// 获取时间戳 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime
console.log("time:", date3.getTime());

// 向上取整 https://mp.weixin.qq.com/s/-VLnevAo5jay_8t_9vvWhg  (40, 41)
console.log(Math.ceil(5.33));
//向下取整
console.log(Math.floor(5.33));
//四舍五入
console.log(Math.round(5.33));
// 取随机数。
console.log(Math.random() * 10);

// window api https://mp.weixin.qq.com/s/-VLnevAo5jay_8t_9vvWhg  (47)

// 路径上loation 上  host+pathname + search

// 类型转化
console.log(Number(""));

console.log(String("1231"));

// 正则  https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions
// 正则案例  https://www.cnblogs.com/zxin/archive/2013/01/26/2877765.html

const url = window.location.href.replace("/", "");

export default {};
